 //
//  Common.swift
//  CZBKWB31
//
//  Created by Linkon Y on 16/8/9.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

 // MARK: - 微博相关信息
 let WBAppKey = "1892705456"
 let WBAppSecret = "8f1fc31c6ac2bc3a3ec64fec3d97a5d5"
 let WBRedirect_uri = "http://www.baidu.com"
 
 // 屏幕的宽&高
 let SCREENW = UIScreen.mainScreen().bounds.width
 let SCREENH = UIScreen.mainScreen().bounds.height
 
 // 切换根控制器通知名字
 let WBSWITCHROOTVCNOTIFICATION = "WBSWITCHROOTVCNOTIFICATION" //主Color
 //表情键盘删除按钮通知
 let WBEMOTICONDELETEBTNNOTIFICATION = "WBEMOTICONDELETEBTNNOTIFICATION"
 //表情键盘按钮通知
 let WBEMOTICONEBTNNOTIFICATION = "WBEMOTICONEBTNNOTIFICATION"
 
 
let AppThemeColor = UIColor.orangeColor()

 //RGB颜色
 func RGB(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1) -> UIColor{
   return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: alpha)
}
 
  //随机色
 func RandomColor() -> UIColor{
    return RGB(CGFloat(random()%256), green: CGFloat(random()%256), blue: CGFloat(random()%256))
 }
 
 /**
  自定义打印
  
  - parameter message:  内容
  - parameter file:     类名
  - parameter function: 方法名
  - parameter line:     行数
  */
 func printLog<T>(message: T, file: String = __FILE__, function: String = __FUNCTION__,line: Int =  __LINE__){
    #if DEBUG
        let newFile = (file as NSString).lastPathComponent
        let result = "\(newFile) [\(line)] \(function) : \(message)"
        print(result)
    #endif
 }

 